package com.bifang.common.constant.enums.common;
/** 码类型 */
public enum CodeTypeEnum {
    person("20", "个人身份码", 300L),
    talent("21", "人才码", 300L),
    company("30", "企业身份码", 0L);
    private String type;
    private String text;
    // 缓存时间 单位秒 默认为缓存5分钟 0 为永久有效
    private Long redisTime = 300L;

    CodeTypeEnum(String type, String text, Long redisTime) {
        this.type = type;
        this.text = text;
        this.redisTime = redisTime;
    }

    public String getType() {
        return this.type;
    }

    public String getText() {
        return this.text;
    }

    public Long getRedisTime() {
        return redisTime;
    }

    public static CodeTypeEnum getByType(String type) {
        for (CodeTypeEnum typeEnum : values()) {
            if (typeEnum.getType().equalsIgnoreCase(type)) {
                return typeEnum;
            }
        }
        return null;
    }
}
